import json
from typing import List, Dict, Any

class PageElement:
    """描述页面元素及其定位路径"""
    def __init__(self, name: str, locator: str, element_type: str = "input"):
        self.name = name
        self.locator = locator
        self.element_type = element_type

    def to_dict(self) -> Dict[str, Any]:
        return {
            "name": self.name,
            "locator": self.locator,
            "type": self.element_type
        }
 